package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class HowMany extends JFrame {

	private JPanel contentPane;
	private JTextField txtHowmany;

	/**
	 * Create the frame.
	 */
	public HowMany(Boolean add) {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 315, 115);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		if(add){
			JLabel lblHowManyDo = new JLabel("How many do you want to add?");
			lblHowManyDo.setBounds(57, 11, 185, 14);
			contentPane.add(lblHowManyDo);
		}
		else
		{
			JLabel lblHowManyDo = new JLabel("How many do you want to remove?");
			lblHowManyDo.setBounds(57, 11, 185, 14);
			contentPane.add(lblHowManyDo);
		}
		
		txtHowmany = new JTextField();
		txtHowmany.setText("howMany");
		txtHowmany.setBounds(57, 36, 86, 20);
		contentPane.add(txtHowmany);
		txtHowmany.setColumns(10);
		
		JButton btnOk = new JButton("OK");
		btnOk.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				//Sabin, how many?
				dispose();
			}
		});
		btnOk.setBounds(153, 36, 89, 20);
		contentPane.add(btnOk);
	}

}
